package com.xw.echo.core;


import com.xw.echo.core.serializer.HessianSerializar;
import com.xw.echo.core.serializer.Serializar;
import lombok.Getter;

public class RPCConfigManager {


    private static Serializar serializer;
    @Getter
    private static Integer maxConnections;
    @Getter
    private static Integer clientThread;
    //从队列获取连接的最大等待时间
    @Getter
    private static Integer maxQueueWaitTime;
    //建立连接的最大等待时间
    @Getter
    private static Integer maxConnectTimeOut;

    // 设置序列化器
    public static void setSerializer(Serializar serializer) {
        RPCConfigManager.serializer = serializer;
    }

    public static void setMaxConnections(int maxConnections) {
        RPCConfigManager.maxConnections = maxConnections;
    }

    // 获取序列化器
    public static Serializar getSerializer() {
        if (serializer == null) {
            // 如果未设置，则使用默认的 Hessian 序列化器
            serializer = new HessianSerializar();
        }
        return serializer;
    }



}